package server;

import java.net.Socket;

import mockup.UserMockup;

import server.tcp.SeparateConnection;

public class Session {
	private static int lastIDIssued = -1;
	private UserMockup user;
	private int sessionID;
		
	private SeparateConnection connection;
	
	public Session(Socket socket) {
		this.sessionID = ++lastIDIssued;
		
		this.connection = new SeparateConnection(socket, this);
	}

	public UserMockup getUser() {
		return user;
	}

	public void setUser(UserMockup user) {
		this.user = user;
	}

	public int getSessionID() {
		return sessionID;
	}

	public SeparateConnection getConnection() {
		return connection;
	}

	public void setConnection(SeparateConnection connection) {
		this.connection = connection;
	}
}
